import java.util.*;

public class EmployeeTest
{
	public static void main(String[] args)
	{
		Employee[] e = new Employee[2];
		e[0] = new Employee("113",1000.00,1900,0,1);
		e[1] = new Employee("112",1000.00,1900,0,1);
		
		Arrays.sort(e);
		
		for(Employee e1:e)
			System.out.println(e1.getName());
	}

}

class Employee extends Person 
{
	

	public Employee(String n, double s, int year, int month, int day)
	{
		super(n);
		salary = s;
		GregorianCalendar c = new GregorianCalendar(year, month, day);
		hireday = c.getTime();	
		id = nextid;
		nextid++;
	}
	
	public Employee(String n, double s)
	{
		super(n);
		salary = s;
		id = nextid;
		nextid++;
	}
	
	public Employee(double s)
	{
		this("Employee #" + nextid, s);
		nextid++;
	}
	
	public boolean eqauls(Object otherObject)
	{
		if (this == otherObject) return true;
		if (otherObject == null) return false;
		if (this.getClass() != otherObject.getClass()) return false;
		
		Employee other = (Employee) otherObject;
		
		return name.equals(other.name) && salary == other.salary && hireday.equals(other.hireday) ;
		
	}
	
	public int hashCode()
	{
		return 3 * name.hashCode() + 7 * new Double(salary).hashCode() + 10 * hireday.hashCode();
	}
	
	public String toString()
	{
		return this.getClass().getName() + "[name:" + name + ", salary:" 
				+ salary + " ,hireday:" + hireday + "]";
	}
	
	public String getDescription()
	{
		return "This person is a Employee.";
	}
	
	public static int getNextId()
	{
		return nextid;
	}
	
	public int getId()
	{
		return id;
	}
	
	public double getSalary()
	{
		return salary;
	}
	
	public Date getHireday()
	{
		return (Date)hireday.clone();
	}
	
	
	public void setHireday(int year, int month, int day)
	{
		GregorianCalendar eh = new GregorianCalendar(year, month, day);
		hireday = eh.getTime();
	}
	
	
	public void raiseSalary(double x)
	{
		salary = salary * x / 100;
	}
	
	
	private double salary;
	private Date hireday;
	private int id;
	private static int nextid = 1;

	}
